<!DOCTYPE html>
<meta charset="UTF-8">
<div style="margin:40px 100px 0 20px">
<form action="save" method="post"class="layui-form">
	<input type="hidden" name="id" data-th-value="${model.id}">
	<input type="hidden" name="parentId" data-th-value="${model.parent==null?null:model.parent.id}">
	<div class="layui-form-item">
	<label class="layui-form-label">名称：</label>
	<div class="layui-input-block">
		<input type="text" name="name" data-th-value="${model.name}" class="layui-input" />
	</div>
	</div>
	<div class="layui-form-item">
   		<label class="layui-form-label">权限：</label>
   		<div class="layui-input-block">
			<select name="role.id" lay-search >
				<option value="" style="display: none;"></option>
				<option th:each="role:${roles}" th:value="${role.id}" th:text="${role.name}" th:selected="${model.role!=null&&role.id==model.role.id}"></option>
			</select>
   		</div>
 	</div>
 	<div class="layui-form-item" >
		<label class="layui-form-label">地址：</label>
		<div class="layui-input-block">
			<input type="text" name="url" data-th-value="${model.url}" class="layui-input" />
		</div>
	</div>
	<div class="layui-form-item" >
		<label class="layui-form-label">排序：</label>
		<div class="layui-input-block">
			<input type="text" name="idx1" data-th-value="${model.idx1}" class="layui-input" />
		</div>
	</div>
</form>
</div>
<script type="text/javascript">
	form = layui.form;
	form.render('select');
</script>